﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DragonSolution.Web.Data.Entity
{
    /// <summary>
    /// 新闻实体
    /// </summary>
    public class NewsInfo
    {
        /// <summary>
        /// 新闻ID
        /// </summary>
        [Key]
        public int NewsID { set; get; }
        /// <summary>
        /// 类别
        /// </summary>
        public int NewsCategory { get; set; }
        /// <summary>
        /// 新闻名称
        /// </summary>
        public string NewsName { set; get; }
        /// <summary>
        /// 新闻作者
        /// </summary>
        public string NewsAuthor { set; get; }
        /// <summary>
        /// 新闻内容
        /// </summary>
        public string NewsContent { set; get; }
        /// <summary>
        /// 新闻发布时间
        /// </summary>
        public DateTime NewsPostTime { set; get; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public int IsDelete { set; get; }
        /// <summary>
        /// 是否置顶
        /// </summary>
        public int IsTop { get; set; }
        /// <summary>
        /// IsTop转bool时用
        /// </summary>
        public bool IsTopValue {
            get { return IsTop == 1 ? true : false; }
            set { IsTop = value ? 1 : 0; }
        }
        /// <summary>
        /// 浏览数量
        /// </summary>
        public int ViewNum { get; set; }
    }
}
